Skip to content

DRY: remove dead code and deduplicate patterns#25

Open
clockblocker wants to merge 5 commits intomasterfrom
nightshift/auto-dry-v2
Open

DRY: remove dead code and deduplicate patterns#25
clockblocker wants to merge 5 commits intomasterfrom
nightshift/auto-dry-v2

Conversation

@clockblocker
Copy link
Copy Markdown
Owner

Summary

  • Delete 3 dead files (~879 lines): wip_keymaker.ts, full-dict-enrtie.ts, endgame.ts
  • Fix insertReplyFromKeymaker import bug (was silently loading C1Richter module)
  • Extract blockOrEmpty helper in fillTemplate.ts to replace 4 identical longDash checks
  • Deduplicate 5 selection-based command registrations in main.ts into a data-driven loop
  • Remove unused deepseekApiKey from types.ts and settings.ts
  • Remove debug console.log statements from utils.ts

Test plan

  • tsc -noEmit passes
  • esbuild production build succeeds
  • Manual smoke test: verify all commands still work in Obsidian

🤖 Generated with Claude Code

clockblocker and others added 4 commits February 17, 2026 21:37
Add CODEOWNERS and docs/ARCHITECTURE.md to define 5 logical ownership
domains: plugin-core, commands, ai-api, prompt-engineering, and
filesystem. Each source file maps to exactly one domain with no
overlapping patterns.

Nightshift-Task: ownership-boundary
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Delete 3 dead files: wip_keymaker.ts, full-dict-enrtie.ts, endgame.ts (~879 lines)
- Fix insertReplyFromKeymaker import pointing to wrong module (C1Richter)
- Extract blockOrEmpty helper to replace 4 identical longDash checks in fillTemplate.ts
- Deduplicate 5 selection-based command registrations in main.ts into data-driven loop
- Remove unused deepseekApiKey from types.ts and settings.ts
- Remove debug console.log statements from utils.ts

Nightshift-Task: auto-dry
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Notice('Generating…') spinner to all 6 AI-powered commands
  (fillTemplate, normalizeSelection, translateSelection,
  insertReplyFromKeymaker, insertReplyFromC1Richter,
  getInfinitiveAndEmoji) with proper cleanup in finally blocks
- Add 30-second timeout to API calls via Promise.race in
  generateContent() to prevent indefinite hangs on network issues
- Replace console.error with Notice in insertReplyFromC1Richter
  error handler for consistent user-facing error reporting

Nightshift-Task: idea-generator
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused imports: z, HarmCategory, HarmBlockThreshold,
  ResponseSchema, TFile, TAbstractFile, requestUrl
- Remove dead startTime/endTime/duration timing variables
- Fix chatKey to include responseSchema flag, preventing cache
  collisions between JSON and text responses
- Remove unused MarkdownView import from getInfinitiveAndEmoji.ts

Nightshift-Task: idea-generator
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add loading spinners and API timeout to commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant